package com.xdtech.parking.vo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.sql.Timestamp;

import com.xdtech.core.model.BaseItem;
import com.xdtech.core.orm.utils.BeanUtils;
import com.xdtech.parking.model.ParkOrderInfo;

import com.xdtech.web.freemark.item.GridColumn;

/**
 * 
 * @author max.zheng
 * @create 2015-06-28 19:18:42
 * @since 1.0
 * @see
 */
public class ParkOrderInfoItem extends BaseItem implements Serializable{
	private static final long serialVersionUID = 1L;
	private Long id;
	@GridColumn(title="订单编号",width=120)
	private String orderNo;
	@GridColumn(title="支付单号",width=230)
	private String payOrderNo;
	@GridColumn(title="微信昵称",width=100)
	private String wxName;
	@GridColumn(title="登录名",width=100)
	private String telephone;
	@GridColumn(title="区域",width=100)
	private String areaCode;
	@GridColumn(title="设备编号",width=100)
	private String deviceCode;
	@GridColumn(title="支付时间",width=100)
	private String payTime;
	@GridColumn(title="支付金额",width=100)
	private Double payAmount;
	@GridColumn(title="支付类型",width=100,dictionaryCode="PARK_PAY_TYPE")
	private String payType;
	@GridColumn(title="支付结果",width=100,formatter={"0=<span style=\"color:red;\">失败</span>","1=<span style=\"color:green;\">成功</span>"})
	private String payResult;
	

	public void setId(Long id) {
		this.id = id;
		addQuerys("id", id);
	}
	public Long getId() {
		return id;
	}
	
	public void setOrderNo(String orderNo) {
		this.orderNo = orderNo;
		addQuerys("orderNo", orderNo);
	}
	public String getOrderNo() {
		return orderNo;
	}
	
	public String getPayOrderNo() {
		return payOrderNo;
	}
	public void setPayOrderNo(String payOrderNo) {
		this.payOrderNo = payOrderNo;
		addQuerys("payOrderNo", payOrderNo);
	}
	public void setWxName(String wxName) {
		this.wxName = wxName;
		addQuerys("wxName", wxName);
	}
	public String getWxName() {
		return wxName;
	}
	
	public void setDeviceCode(String deviceCode) {
		this.deviceCode = deviceCode;
		addQuerys("deviceCode", deviceCode);
	}
	public String getDeviceCode() {
		return deviceCode;
	}
	
	public void setPayTime(String payTime) {
		this.payTime = payTime;
		addQuerys("payTime", payTime);
	}
	public String getPayTime() {
		return payTime;
	}
	
	public void setPayAmount(Double payAmount) {
		this.payAmount = payAmount;
		addQuerys("payAmount", payAmount);
	}
	public Double getPayAmount() {
		return payAmount;
	}
	
	public void setPayType(String payType) {
		this.payType = payType;
		addQuerys("payType", payType);
	}
	public String getPayType() {
		return payType;
	}
	
	public void setPayResult(String payResult) {
		this.payResult = payResult;
		addQuerys("payResult", payResult);
	}
	public String getPayResult() {
		return payResult;
	}
	
	public String getAreaCode() {
		return areaCode;
	}
	public void setAreaCode(String areaCode) {
		this.areaCode = areaCode;
	}
	public String getTelephone() {
		return telephone;
	}
	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}
	/**
	 * 根据model构建vo
	 * 
	 * @author max
	 * @return
	 */
	public static ParkOrderInfoItem createItem(ParkOrderInfo parkOrderInfo) {
		ParkOrderInfoItem parkOrderInfoItem = new ParkOrderInfoItem();
		BeanUtils.copyProperties(parkOrderInfoItem, parkOrderInfo);
		//自定义属性设置填充
		return parkOrderInfoItem;
	}
	/**
	 * 根据model集合创建vo集合
	 * 
	 * @author max
	 * @return
	 */
	public static List<ParkOrderInfoItem> createItems(List<ParkOrderInfo> parkOrderInfos) {
		List<ParkOrderInfoItem> parkOrderInfoItems = new ArrayList<ParkOrderInfoItem>();
		for (ParkOrderInfo parkOrderInfo : parkOrderInfos) {
			parkOrderInfoItems.add(createItem(parkOrderInfo));
		}
		return parkOrderInfoItems;
	}
}
